Skip to content

Conversation

@silasjoisten
Copy link
Collaborator

@silasjoisten silasjoisten commented Jul 25, 2025

closes #63 #62

@silasjoisten silasjoisten self-assigned this Jul 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.80%. Comparing base (d4b9e01) to head (3f09650).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #66      +/-   ##
============================================
+ Coverage     93.79%   93.80%   +0.01%     
- Complexity      470      471       +1     
============================================
  Files            73       73              
  Lines          1643     1646       +3     
============================================
+ Hits           1541     1544       +3     
  Misses          102      102              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

foreach ($target as &$value) {
if (\is_string($value) && \array_key_exists($value, $relationMap)) {
$value = $relationMap[$value];
return $this->doResolve($target, $relationMap, []);
Copy link
Contributor

@frastel frastel Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are two things done:

  • deep resolving of relations
  • not to replace the uuids themselves

This would fix my both opened issues. But I think you could simplify this approach a bit.
We have implemented our own StoryResolver in the meantime (I had not enough time yet to create a PR with our version) and we did it like this:

// resolve relations which may be included in the resolved relations themselves
$this->doResolve($relationMap, $relationMap);

// resolve relations in the main target
$this->doResolve($target, $relationMap);

return $target;
        
private function doResolve(array &$target, array $relationMap): void
//...
// uuid check here like it is done in this PR

We are passing the $target as reference because our API responses are quite huge and we want to lower the memory usage on our servers.

In this case you do not need the $seen parameter and can assume that the resolved relations are already resolved when the main stories are looped.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there sorry for the delay i found a more memory saving appoach. if you want to test it feel free.

@silasjoisten silasjoisten merged commit 4ea19c1 into master Sep 18, 2025
4 checks passed
@silasjoisten silasjoisten deleted the fix/nested-resolving branch September 18, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolved Relations are not resolved themselves

3 participants